const joi = require("joi");

const id = joi.required();
const name = joi
  .string()
  .pattern(/^([a-zA-Z0-9\u4e00-\u9fa5\·]{1,10})$/)
  .required();
const sex = joi
  .string()
  .pattern(/男|女/)
const department = joi
  .string()
  .pattern(/总裁办|项目部/)
const identity = joi
  .string()
  .pattern(/产品管理员|用户|消息管理员/)
const email = joi
  .string()
  .pattern(
    /^(([a-zA-Z0-9_\-\.]+)@([a-zA-Z0-9_\-\.]+)\.([a-zA-Z]{2,5}){1,25})$/
  );
const newPassword = joi
  .string()
  .pattern(/^(?=.*[^0-9].*)[\S]{1,50}$/)
  .min(6)
  .max(12);
const account = joi.string().alphanum().min(6).max(12).required();

exports.addAdmin = {
    body:{
        name,
        sex,
        account,
        newPassword,
        email,
        department,
        identity
    }
}